package org.osflash.arp
{
	import flash.net.Responder;
	import org.osflash.arp.AMF0Service;
	import org.osflash.arp.AMF0RelayResponder;
	
	// This class exists to provide a simple migration 
	// pattern for Arp projects using AMFPHP (AMF0)
	public class AMF0PendingCall
	{
		private var serviceRef:AMF0Service;
		private var methodName:String;
		private var args:Array;
		
		public function AMF0PendingCall ( serviceRef:AMF0Service, methodName:String, args:Array )
		{
			this.serviceRef = serviceRef;
			this.methodName = methodName;
			this.args = args;
			
			trace ("Created AMF0PendingCall for " + methodName );
		}
		
		public function set responder ( r:AMF0RelayResponder ):void
		{
			
			trace ("responder called");
			var responder:Responder = new Responder( r.result, r.fault );
			serviceRef.invoke ( methodName, args, responder );
		}
	}
}